<recursiveIntIterator>

* means multiply function.
^ means power function.

Starting from nodeExecutor.12.xml and the paper I wrote on with a pen.

Define functions that take an int array, or an object array containing int array(s), as the parameter.
The int at index 0 will always iterate from 0 to a number known before the function is called.
For example, if x and y are arrays size 3 and 5, and it iterates from 0 to x.size^y.size-1,
then the int array should be size 1+y.size.
All ints except the first will range 0 to x.size-1.
All ints except the first, together, are a base-3 number that equals the first int.

The function must know what x.size and y.size are, so maybe the int array can not be size 1+y.size.
The function may need to know other things too, but I want to use recursion to avoid that need.
For example, if x is a view of some other arrays c*((b*c)^(d*e)), and y is a view of some of those same arrays and possible other arrays, then I may want the recursion to combine the duplicated iterations or not. If iterating over g*h and g*i, then that could be reduced to iterating over g*h*i or used literally as g*h*g*i.

This network is what I wrote on a paper with a pen to calculate how a bayesian algorithm would be represented in this system:

s means size of array.
i means current index during iterating.
xi*ys means ys quantity of xi. It does not mean xi quantity of ys.
(xs*ys)i means the current index of an iteration from 0 to xs*ys-1.
x --> y means x contains all information in y, but may not work as y --> x.

xs
ys
xi --> xs
yi --> ys
xs^ys --> xs
xs^ys --> ys
xs*ys --> xs
xs*ys --> ys
xi*ys --> xs^ys
(xs^ys)i --> xi*ys
(xs*ys)i --> xi
(xs*ys)i --> yi
(xs*ys)i --> xs*ys
yi*(xi*ys) --> (xs^ys)i
yi*(xi*ys) --> (xs*ys)i
ys*(xs^ys)i --> yi*(xi*ys)
yi*(xs^ys)i --> ys*(xs^ys)i
yi*(xs^ys)i --> yi*(xi*ys)

A bayesian-node's arrays would include an array containing BAYESFALSE and BAYESTRUE, size xs = 2, Object array of child-bayesian-nodes, size ys, and floating point array of bayesian-weights, size xs^ys, and floating point array of sums of weights for each child (1 floating point for BAYESFALSE and one for BAYESTRUE, for each child), size xs*ys. The function that processes a bayesian node would obey the iteration order defined by yi*(xs^ys)i, or ys*(xs^ys)i would also work if you wanted to use ys quantity of floating points at a time. yi*(xs^ys)i lets you use a constant quantity of floating points each iteration, that does not depend on quantity of bayesian node childs. Variations of these iteration orders, array sizes, types of arrays, etc will evolve, but for now I'm hard-coding a few of the best artificial intelligence algorithms in a way that can evolve. I'm writing them as data instead of algorithms. Javassist can optimize these long chains of logic into a single Java class while Audivolv runs.

xi*ys <--> (xs^ys)i

Try to define each transformation, starting from yi*(xs^ys)i, as a simple optimizable function.

How many inputs and outputs should each function have? 1 input and 1 output? 2 inputs and 1 output?

The goal is for the whole process to have 1 input (0 to yi*(xs^ys)i - 1) and 2 outputs (0 to xs^ys - 1, and 0 to xs*ys - 1).

It should later be optimized to this:
for(int yi=0; yi<ys; yi++){
	for(int xsPowerYsI=0; xsPowerYsI<xsPowerYsS; xsPowerYsI++){
		int xi = ...viewing xsPowerYsI as a base-xs number with ys quantity of digits, return digit number yi...;
		The 2 ints are xi and xsPowerYsI;
	}
}

Can I generalize * and ^ in the same way you can view an int as an int array size 32 containing 0 or 1 in each index?

xi*ys can be written as an int array size ys where each int is between 0 and xs-1.

xi*yi or (xs*ys)i can be written as an int array sie 2 with ranges 0 to xs-1, and 0 to ys-1.

A factorial function could be an int array where each index has a smaller range than the last, smaller by 1.


Is this type of variable-size digits useful for floating pointer numbers? Example: base-pi. Probably not.
But it could be useful for defining the floating point type as an int array size 64, or some smaller size using more bits of each int.


Should all ints be represented as the multiply of prime ints? Example: 100 is 2*2*5*5


Big integers could be represented as the multiply of prime ranges.
For example, 100^3 would be 12 ranges: 2*2*5*5*2*2*5*5*2*2*5*5


Does this optimization restrict sizes too much?: All ints must not have any prime as a factor more than once.
Examples: 1, 2, 3, 5, 2*3=6, 7, 2*5=10, 11, 13, 2*7=14, 3*5=15, 17, 19, 3*7=21, 2*11=22, 23, 2*13=26, 29, 2*3*5=30
The optimization is that small numbers can be written as 1 int where only the first 32 (or 31?) primes are available.
This prime optimization probably restricts things too much.


Trying again...
The goal is for the whole process to have 1 input (0 to yi*(xs^ys)i - 1) and 2 outputs (0 to xs^ys - 1, and 0 to xs*ys - 1).

If xs is 3 and ys is 5:

3^5 is 3*3*3*3*3
5*(3^5) is 5*3*3*3*3*3

Input 5*3*3*3*3*3, output 3*3*3*3*3 and 5*oneOfThe3s.

How would it know there are 5 3s if its all together like this 5*3*3*3*3*3?











</recursiveIntIterator>